<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<jsp:include page="../../../common/head.jsp">
			 <jsp:param name="_spPage" value="true"/>
			 <jsp:param name="_useCalendar" value="true"/>
			 <jsp:param name="_useTab" value="true"/>
		</jsp:include>

		<title>消息模板管理</title>
		<script language="JavaScript">
			$(document).ready(function()
			{
				xjTabs.initTab({firstTabSeq:1});
			});
			//当前页不显示消息通知
			_doNotShowMessageNotice = true;
		    function updDraftMessage(messageId){
			    window.location.href="updateDraftMessage.do?messageId="+messageId;
		    } 
			function delDraftMessage(messageId){
				if(confirm("确认删除？"))
				{
				    var returnVal = ModalWindow("jump.do?path=delMessage.do&type=草稿箱删除&messageId="+messageId,640,480);
				    if(returnVal=="ok")
				    {
				    	 xjSpPage.spPageSubmit();
				    }
				}
			}
			function delBatchMessage(){
			    var str = xjCommon.getValueStr("messageId",",");
				if(str!="")
				{
					if(confirm("确认删除所选内容？"))
					{
						document.form1.action="deleteBatchMessage.do?type=草稿箱删除";
						document.form1.submit();
					}
				}
				else
					alert("请选择要删除的消息！");
		    }
		    function addMessage()
			{
				window.location.href="${ctx}/jsp/system/message/add_message.jsp";
			}
		</script>
	</head>
	<body>
	<form action="listDraftMessage.do" name="form1" id="Form" method="post">
	<div id="body_div">
	<w:ShowTitle name="草稿箱管理">
	<w:TitleButton funcName="发消息" onClickFunction="addMessage()" urlImg="${ctx}/images/main/add.png"/>
	<w:TitleButton funcName="删除" onClickFunction="delBatchMessage()" urlImg="${ctx}/images/main/delete.png"/>
	</w:ShowTitle>
	<div id="body_content">
		<div class="Sliding_tab">
            <ul>
	           <li></li><li><span class="tabsLink" id="setTab0" link="listMessage.do" type="jump">收信箱</span></li><li></li>
	           <li></li><li><span class="tabsLink" id="setTab1" link="listDraftMessage.do" type="jump">草稿箱</span></li><li></li>
	           <li></li><li><span class="tabsLink" id="setTab2" link="listSendMessage.do" type="jump">发信箱</span></li><li></li>
            </ul>
       </div>
		<table width="100%" id="content1" class="tb1">
			<tr>
				<td class="td_title" width="150">主题</td>
				<td width="#" class="td_title">内容</td>
				<td class="td_title" width="150">发送时间</td>
				<td class="td_title" width="150">操作</td>
			</tr>
			<c:forEach items="${datalist}" var="obj">
				<tr id="${obj.messageId}">
					<td>${obj.messageTitle}</td>
					<td>${obj.messageContent}</td>
					<td><fmt:formatDate value="${obj.createDate}" pattern="yyyy-MM-dd"/></td>
					<td>
					<a href="#" onclick="updDraftMessage('${obj.messageId}')">查看</a>&nbsp
					<a href="#" onclick="delDraftMessage('${obj.messageId}')">删除</a>
					</td>
				</tr>
			</c:forEach>
		</table>
		<w:spPage />
		</div>
	</div>	
	</form>
	</body>
</html>
